//
//  DDChannelLabel.m
//  NetEaseNews
//
//  Created by dqw on 15/7/24.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "DDChannelLabel.h"
#define KBIGFONT 18
#define KAMALLFONT 15

@implementation DDChannelLabel
+ (instancetype)channelLabelWithName:(NSString *)name
{
    DDChannelLabel *label = [[DDChannelLabel alloc]init];
    label.text = name;
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:KBIGFONT];
    [label sizeToFit];
    label.font = [UIFont systemFontOfSize:KAMALLFONT];
    return label;
}

- (void)setScale:(CGFloat)scale
{
    _scale = scale;
    CGFloat maxScale = KBIGFONT * 1.0 / KAMALLFONT - 1;
    self.transform = CGAffineTransformMakeScale(maxScale * scale + 1, maxScale *scale + 1);
    self.textColor = [UIColor colorWithRed:scale green:0 blue:0 alpha:1];
}


@end
